/**
 * Copyright By Nanjing Fujitsu Nanda Software Technology Co., Ltd
 * 下午1:16:51
 * Result.java
 * 
 */
package com.fujitsu.nanjing.mobile.model;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

import java.util.Hashtable;

/**
 * @author qixb.fnst
 * 
 */
public class Result implements KvmSerializable {
    private int responseCode;

    private String responseData;

    private String remark;

    @Override
    public String toString() {
        return "Result [responseCode=" + responseCode + ", responseData="
                + responseData + ", remark=" + remark + "]";
    }

    @Override
    public Object getProperty(int arg0) {
        switch (arg0) {
        case 0:
            return this.responseCode;
        case 1:
            return this.responseData;
        case 2:
            return this.remark;

        default:
            break;
        }
        return null;
    }

    public int getResponseCode() {
        return responseCode;
    }

    public void setResponseCode(int responseCode) {
        this.responseCode = responseCode;
    }

    public String getResponseData() {
        return responseData;
    }

    public void setResponseData(String responseData) {
        this.responseData = responseData;
    }

    @Override
    public int getPropertyCount() {
        return 3;
    }

    @SuppressWarnings("rawtypes")
    @Override
    public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
        switch (arg0) {
        case 0:
            arg2.name = "responseCode";
            arg2.type = PropertyInfo.INTEGER_CLASS;
            break;
        case 1:
            arg2.name = "responseData";
            arg2.type = PropertyInfo.STRING_CLASS;
            break;
        case 2:
            arg2.name = "remark";
            arg2.type = PropertyInfo.STRING_CLASS;
            break;

        default:
            break;
        }

    }

    @Override
    public void setProperty(int arg0, Object arg1) {
        switch (arg0) {
        case 0:
            this.responseCode = Integer.parseInt(arg1.toString());
            break;
        case 1:
            this.responseData = arg1.toString();
            break;
        case 2:
            this.remark = arg1.toString();
            break;

        default:
            break;
        }

    }

    /**
     * @return the remark
     */
    public String getRemark() {
        return remark;
    }

    /**
     * @param remark
     *            the remark to set
     */
    public void setRemark(String remark) {
        this.remark = remark;
    }

}
